package netective.api.gatherer;

import jpcap.NetworkInterface;
import jpcap.NetworkInterfaceAddress;

public class DeviceInterface extends NetworkInterface {

	/**
	 * State of device. It can be on or off.
	 */
	private boolean state;
	
	public boolean isState() {
		return state;
	}

	public void setState(boolean state) {
		this.state = state;
	}
	
	public String stateToString() {
		return state?"ON":"OFF";
	}

	public DeviceInterface(String name, String description, boolean loopback,
			String datalink_name, String datalink_description, byte[] mac,
			NetworkInterfaceAddress[] addresses) {
		super(name, description, loopback, datalink_name, datalink_description, mac,
				addresses);
	}
	
	public DeviceInterface(String name, String description, boolean loopback,
			String datalink_name, String datalink_description, byte[] mac,
			NetworkInterfaceAddress[] addresses, boolean state) {
		super(name, description, loopback, datalink_name, datalink_description, mac,
				addresses);
		this.state = state;
	}
	
	public DeviceInterface(NetworkInterface n) {
		super(n.name, n.description, n.loopback, n.datalink_name, n.datalink_description,
				n.mac_address, n.addresses);
	}
	
	public DeviceInterface(NetworkInterface n, boolean state) {
		super(n.name, n.description, n.loopback, n.datalink_name, n.datalink_description,
				n.mac_address, n.addresses);
		this.state = state;
	}

}
